package pl.alipiec.stockview.master;

import java.util.HashMap;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

import org.hornetq.core.logging.Logger;

public class IndexData {
	
	private Map<String, String> indexUrls = new HashMap<String, String>();
	private Logger log = Logger.getLogger(getClass());
	
	public IndexData(Properties props) {
		
		String names = props.getProperty("index.names");
		if( names != null && names.length() > 0 ){
			String[] indexes = names.split(",");
			
			for(String index :indexes){
				String address = props.getProperty(index);
				indexUrls.put(index, address);
			}
		}
		
	}
	
	public Set<String> keySet() {
		return indexUrls.keySet();
	}
	
	public String get(String index){
		return indexUrls.get(index);
	}

}
